# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.WalletObjects.V1.Model.DiffChecksumsResponse do
  @moduledoc """
  Backend response for a Diff get checksums response. For details on the Scotty Diff protocol, visit http://go/scotty-diff-protocol.

  ## Attributes

  *   `checksumsLocation` (*type:* `GoogleApi.WalletObjects.V1.Model.CompositeMedia.t`, *default:* `nil`) - Exactly one of these fields must be populated. If checksums_location is filled, the server will return the corresponding contents to the user. If object_location is filled, the server will calculate the checksums based on the content there and return that to the user. For details on the format of the checksums, see http://go/scotty-diff-protocol.
  *   `chunkSizeBytes` (*type:* `String.t`, *default:* `nil`) - The chunk size of checksums. Must be a multiple of 256KB.
  *   `objectLocation` (*type:* `GoogleApi.WalletObjects.V1.Model.CompositeMedia.t`, *default:* `nil`) - If set, calculate the checksums based on the contents and return them to the caller.
  *   `objectSizeBytes` (*type:* `String.t`, *default:* `nil`) - The total size of the server object.
  *   `objectVersion` (*type:* `String.t`, *default:* `nil`) - The object version of the object the checksums are being returned for.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :checksumsLocation => GoogleApi.WalletObjects.V1.Model.CompositeMedia.t() | nil,
          :chunkSizeBytes => String.t() | nil,
          :objectLocation => GoogleApi.WalletObjects.V1.Model.CompositeMedia.t() | nil,
          :objectSizeBytes => String.t() | nil,
          :objectVersion => String.t() | nil
        }

  field(:checksumsLocation, as: GoogleApi.WalletObjects.V1.Model.CompositeMedia)
  field(:chunkSizeBytes)
  field(:objectLocation, as: GoogleApi.WalletObjects.V1.Model.CompositeMedia)
  field(:objectSizeBytes)
  field(:objectVersion)
end

defimpl Poison.Decoder, for: GoogleApi.WalletObjects.V1.Model.DiffChecksumsResponse do
  def decode(value, options) do
    GoogleApi.WalletObjects.V1.Model.DiffChecksumsResponse.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.WalletObjects.V1.Model.DiffChecksumsResponse do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
